import React from "react";
import { Button, Flex } from "antd";
import "../../i18n/config.js";

//使用
import { useTranslation } from "react-i18next";
const App = () => {
const { t, i18n } = useTranslation();

  const zz = () => {
    console.log("点击了");
    alert("点击了");
  };
  return (
    <Flex
      wrap
      gap="small"
      className="site-button-ghost-wrapper"
      style={{ position: "absolute", top: "40px", left: "10px" }}
    >
     
     
      {t("about")}
      <Button
        type="primary"

        onClick={() => i18n.changeLanguage(i18n.language == "en" ? "zh" : "en")}
      >
        {i18n.language == "en" ? "中文" : "英文"}
      </Button>
      <Button type="primary" danger ghost onClick={zz}>
       {t("SwitchTheme")} {t("English")}
      </Button>
    </Flex>
  );
};

export default App;

//语言切换
